<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
	<head>
		<meta charset="utf-8">
		<title>管理端登录/注册</title>
		<script src="../static/js/jquery-3.3.1.min.js"></script>
		<script src="../static/js/bootstrap.min.js"></script>
		<link href="../static/css/bootstrap.min.css" type="text/css" rel="stylesheet" />

        <script type="text/javascript" src="../static/js/wow.min.js"></script>
        <link href="../static/css/animate.css" type="text/css" rel="stylesheet"/>

		<style>
			.page-header h3{
				font-weight: 800;
			}
		</style>

		<script>
			$(document).ready(function(){

				// 登录
				$('.loginBtn').click(function () {



					if ($('#adminId').val().length==0){
						alert("账号不能为空")
						return false;
					}
					if ($('#adminPassword').val().length==0){
						alert("密码不能为空")
						return false;
					}
					//ajax
					$.post(
							"${pageContext.request.contextPath}/adminLogin",
							$('#loginForm').serialize(), //{"adminId":adminId,"adminPassword",adminPassword}
							function (data) {
								if (data == 0) {
									alert("登录失败");
								}else if(data == 1 ){
									var $url = "${pageContext.request.contextPath}" +'/jsp/admin/admin/admin.jsp';
									$(window).attr('location',$url);


								}
							}
					)
				});

                $('.index').click(function () {
                    var $url = "${pageContext.request.contextPath}" +'/index.jsp';
                    $(window).attr('location',$url);
                });

                //wow 动画
                var wow = new WOW({
                    boxClass: 'wow',
                    animateClass: 'animated',
                    offset: 0,
                    mobile: true,
                    live: true
                });
                wow.init();



			});
		</script>

	</head>
	<body background="../static/img/bg.png">
		<div class="contains" style="width: 50%;  margin: 200px auto;">
			<div class="logo text-center"><img src="../static/img/logo.png" width="200px" /></div>

			<div class="login">
				<script>
					$('.login').show();
				</script>
				<div class="panel panel-collapse panel-primary text-center">
					<div class="page-header panel-danger">
						<h3 class="text-info wow bounceInDown"  data-wow-duration="1s" data-wow-delay="0.5s" data-wow-offset="10"
                            data-wow-iteration="1">欢迎使用网络在线选课系统-后台登录</h3>
					</div>
					<div class="panel-body text-center">
						<form class="form form-horizontal" id="loginForm">
							<div class="form-group form-inline">
								<label class="wow fadeInDown" data-wow-duration="1s" data-wow-delay="0.2s" data-wow-offset="10"
                                       data-wow-iteration="1">后台账号：<input type="text" class="form-control" name="adminId" id="adminId"   placeholder="请输入账号" /></label>
								<label class="tip adminIdTip text-danger"></label>
							</div>
							<div class="form-group form-inline">
								<label class="wow fadeInDown" data-wow-duration="1s" data-wow-delay="0.2s" data-wow-offset="10"
                                       data-wow-iteration="1">后台密码：<input type="password" class="form-control" name="adminPassword" id="adminPassword" placeholder="请输入密码" /></label>
								<label class="tip adminPasswordTip text-danger"></label>
							</div>
							<div class="form-group form-inline">
								<button type="button"  class="btn btn-info  loginBtn wow bounceInRight" data-wow-duration="1s" data-wow-delay="0.5s" data-wow-offset="10"
                                        data-wow-iteration="1">登录</button>
								<button type="button" class="btn btn-danger index wow bounceInLeft"   data-wow-duration="1s" data-wow-delay="0.5s" data-wow-offset="10"
                                        data-wow-iteration="1">主页</button>
								<label class="tip statusTip text-danger"></label>
							</div>
						</form>
					</div>
					<div class="panel-footer ">
						<h5>@2019-2019 JSP期末项目</h5>
					</div>

				</div>
			</div>




		</div>
	</body>
</html>
